 @extends("h5.layouts.main")
@section('content')
<?php
use App\admin\Service\OA;
use App\Models\Admin\OrderTempModel;
use App\Jobs\Fun;
use App\Models\CompanysModel;
$uid=OA::$user->getId();
$orderTempArray = OrderTempModel::with('orderDetail')->where('fid',$uid)
         ///   ->where('play_status','=',OrderTempModel::play_status_zhifu)

           ->orderBy('id','DESC')
            ->get()->toArray();
  //print_r($orderTemp);exit;

?>
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../css/app.css">
    <link rel="stylesheet" type="text/css" href="../css/orderGrad.css">
<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
 
    <!-- 我的订单（抢单和订单） -->
    <div class="orderDockingPage">
        <div class="orderParamTitle">
            订单对接
            <a href="/h5/myset.html">
                <img src="../images/return.png" class="orderRtns" >
            </a>
        </div>
        <div style="height:1.066667rem"></div>
        <div class="content">
            <ul class="list myOrderList">
                <?php foreach ($orderTempArray as $t) {
                      ?>
                <li class="detail" out_trade_no="<?= $t['out_trade_no'] ?>" bale="<?= $t['bale'] ?>">
                    <span class="detail__span" style="background-image:url(<?= Fun::pImg($t['order_detail']['img']) ?>)" alt=""></span>                   
                    <ul>
                        <li>
                            <span>订单名称：</span>
                            <span><?= $t['order_detail']['name']??'' ?></span>
                            <?php if($t['status']!= OrderTempModel::status_wancheng){ ?>
                            <span><?= OrderTempModel::getstatus($t['status']) ?></span>
                            <?php }else{
                                ?><a class="button kongzhitai" href="/h5/order/kongzhitai.html?out_trade_no=<?= $t['out_trade_no'] ?>">控制台</a> <?php
                            } ?>
                        </li>
                        <li >
                            <span>公司名称：</span>
                            <span><?= CompanysModel::where('uid',$t['cid'])->value('com_name') ?></span>
                            <?php if($t['status']== OrderTempModel::status_wancheng){ ?>
                            <a class="button jiaoliu" call="<?= $t['cid']  ?>">商务交流</a>
                            <?php }else{
                                ?><a></a> <?php
                            } ?>
                        </li>
                        <li>
                            <span>交货期限：</span>
                            <span><?php echo $t['order_detail']['period'] ? date('Y-m-d ',$t['order_detail']['period']) : ''; ?></span>


                            <?php if($t['status']== OrderTempModel::status_wancheng){ ?>
                            <a class="status"><?php
                                $userOrder=\App\Models\User\UserOrdersModel::where([
                                    'order_no'=>$t['out_trade_no']
                                ])->select('status')->first();
                                if($userOrder){
                                    $status=$userOrder['status'];
                                    echo \App\Models\User\UserOrdersModel::getStatus($status);
                                }

                                ?></a>
                             <?php } ?>




                        </li>
                    </ul>
                </li> 
                <?php } ?>
                
                
                
                
                
                
            </ul>
        </div>
    </div>
    <script type="text/javascript" src="../js/app.js"></script>
    <script type="text/javascript" src="../js/orderPageChange.js"></script>
    <script type="text/javascript" src="../js/alertMsg.js"></script>
 
 

@stop